<%--
  Created by IntelliJ IDEA.
  User: kwc13
  Date: 2023-12-6
  Time: 上午 08:09
  To change this template use File | Settings | File Templates.
--%>
<!-- 标记为HTML格式 -->
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page isELIgnored="false" %>
<!-- 设置页面为Chain -->
<html lang="ch">
<head>
    <title>小米商城后台管理</title>
    <!-- 设置地址栏主题背景颜色 -->
    <meta name="theme-color" content="#000000">
    <!-- 页面描述 -->
    <meta name="description" content="页面描述信息">
    <!-- 移动端显示 -->
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <!-- 页面Logo -->
    <link rel="shortcut icon" href="http://localhost:8083/resource_packs/images/logo.png">
    <!-- CSS -->
    <link href="${pageContext.request.contextPath}/other/style/background/after_sales.css" rel="stylesheet"
          type="text/css"/>

    <script src="${pageContext.request.contextPath}/other/component/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/other/scripts/background/after_sales.js"></script>
</head>
<body>
<div class="head">
    <div class="title">
        <span>售后管理</span>
    </div>

    <div class="search">
        <div class="search-input">
            <label>
                <input type="text" placeholder="请输入售后ID">
            </label>
        </div>
        <div class="search-img">
            <img src="http://localhost:8083/resource_packs/images/search_%23fff.png" alt="搜索">
        </div>

    </div>
</div>
<div class="other-operate">
    <div class="sift">
        <label for="type">类型:</label>
        <select name="languages" id="type">
            <option value="0">维修</option>
            <option value="1">以旧换新</option>
            <option value="2">退货</option>
            <option value="3">清洗</option>
        </select>
    </div>
    <div class="sift">
        <label for="status">状态:</label>
        <select name="languages" id="status">
            <option value="0">申请中</option>
            <option value="1">申请通过</option>
            <option value="2">申请失败</option>
        </select>
    </div>
    <div>
        <span class="date">时间:</span>
        <label for="date-flashback"></label>
        <jsp:useBean id="afterSalesDate" scope="request" type="java.lang.String"/>
        <input type="radio" id="date-flashback" name="drone" value="0" ${afterSalesDate == 0 ? 'checked' : ''}/>倒序
        <label for="date-positive-order"></label>
        <input type="radio" id="date-positive-order" name="drone" value="1" ${afterSalesDate == 1 ? 'checked' : ''}/>正序
    </div>
    <div class="sift-button">
        <button class="select">查询</button>
    </div>
</div>
<table class="recycle-bin-table">
    <tr>
        <th>
            ID
        </th>
        <th>
            类型
        </th>
        <th>
            有无发票
        </th>
        <th>
            发票日期
        </th>
        <th>
            服务方式
        </th>
        <th>
            申请状态
        </th>
        <th>
            申请日期
        </th>
        <th>
            操作
        </th>
    </tr>
    <jsp:useBean id="afterSalesPage" scope="request" type="com.xm.entity.Page"/>
    <c:forEach var="afterSales" items="${afterSalesPage.data}">
        <tr>
            <td class="recycle-bin-id">
                    ${afterSales.afterSalesId}
            </td>
            <td>
                <c:if test="${afterSales.afterSalesType == 0}">
                    维修
                </c:if>
                <c:if test="${afterSales.afterSalesType == 1}">
                    以旧换新
                </c:if>
                <c:if test="${afterSales.afterSalesType == 2}">
                    退货
                </c:if>
                <c:if test="${afterSales.afterSalesType == 3}">
                    清洗
                </c:if>
            </td>
            <td>
                <c:if test="${afterSales.isInvoice == 0}">
                    有发票
                </c:if>
                <c:if test="${afterSales.isInvoice != 0}">
                    无发票
                </c:if>
            </td>
            <td>
                    ${afterSales.invoiceDate}
            </td>
            <td>
                <c:if test="${afterSales.serviceMode == 0}">
                    上门
                </c:if>
                <c:if test="${afterSales.serviceMode != 0}">
                    寄送
                </c:if>
            </td>
            <td>
                <c:if test="${afterSales.afterSalesState == 0}">
                    申请中
                </c:if>
                <c:if test="${afterSales.afterSalesState == 1}">
                    申请失败
                </c:if>
                <c:if test="${afterSales.afterSalesState == 2}">
                    申请通过
                </c:if>
            </td>
            <td>
                    ${afterSales.afterSalesDate}
            </td>
            <td class="operate">
                <button class="view">查看</button>
            </td>
        </tr>
    </c:forEach>
</table>
<div class="pagination-function">
    <ul class="pagination">
        <c:if test="${afterSalesPage.pageNumber ne 1}">
        <li><a href="?menuId=106&pageNumber=1&pageSize=${afterSalesPage.pageSize}">首页</a>
        <li><a href="?menuId=106&pageNumber=${afterSalesPage.pageNumber - 1}&pageSize=${afterSalesPage.pageSize}">上一页</a>
            </c:if>

            <c:forEach var="page" begin="1" end="${afterSalesPage.totalPages}">
            <c:choose>
            <c:when test="${page eq afterSalesPage.pageNumber}">
        <li><a href="?menuId=106&pageNumber=${page}&pageSize=${afterSalesPage.pageSize}" class="active">${page}</a>
            </c:when>
            <c:otherwise>
            <c:if test="${page eq 1 or page eq afterSalesPage.totalPages or (page ge afterSalesPage.pageNumber - 2 and page le afterSalesPage.pageNumber + 2)}">
        <li><a href="?menuId=106&pageNumber=${page}&pageSize=${afterSalesPage.pageSize}">${page}</a>
            </c:if>
            <c:if test="${page eq afterSalesPage.pageNumber - 3}">
        <li><span>...</span>
            </c:if>
            <c:if test="${page eq afterSalesPage.pageNumber + 3}">
        <li><span>...</span>
            </c:if>
            </c:otherwise>
            </c:choose>
            </c:forEach>

            <c:if test="${afterSalesPage.pageNumber ne afterSalesPage.totalPages}">
        <li><a href="?menuId=106&pageNumber=${afterSalesPage.pageNumber + 1}&pageSize=${afterSalesPage.pageSize}">下一页</a>
        <li><a href="?menuId=106&pageNumber=${afterSalesPage.totalPages}&pageSize=${afterSalesPage.pageSize}">尾页</a>
            </c:if>
    </ul>

</div>

<!-- 弹窗 -->
<div class="window" style="display: none">
    <div class="pop-up-shade-layer"></div>
    <div class="pop-ups">
        <div class="pop-ups-title">
            <span>售后详情</span>
            <img src="http://localhost:8083/resource_packs/images/pop_ups_closes.png"
                 alt="弹窗关闭" class="pop-ups-down">
        </div>
    </div>

</div>

</body>
</html>
